import Vue from 'vue'
import VueRouter from 'vue-router'
import Tabbar from '@/components/Tabbar.vue'
// 引入路由组件-懒加载
const Article = () => import('@/views/article')
const Video = () => import('@/views/video')
const User = () => import('@/views/user')
const Question = () => import('@/views/question')
const Home = () => import('@/views/home')
const Login = () => import('@/views/login')
Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    components: { default: Home, tabbar: Tabbar }
  },
  {
    path: '/question',
    components: { default: Question, tabbar: Tabbar }
  },
  {
    path: '/user',
    components: { default: User, tabbar: Tabbar }
  },
  {
    path: '/video',
    components: { default: Video, tabbar: Tabbar }
  },
  {
    path: '/article',
    component: Article
  },
  {
    path: '/login',
    component: Login
  }
]

const router = new VueRouter({
  routes
})

export default router
